package org.jason.common.exception;

import lombok.Getter;
import org.jason.model.common.enums.HttpCodeEnum;

@Getter
public class ServiceException extends RuntimeException {
    private final HttpCodeEnum httpCodeEnum;

    private final String msg;

    public ServiceException() {
        this.httpCodeEnum = HttpCodeEnum.SERVER_ERROR;
        this.msg = HttpCodeEnum.SERVER_ERROR.getMsg();
    }

    public ServiceException(String msg) {
        this.httpCodeEnum = HttpCodeEnum.SERVER_ERROR;
        this.msg = msg;
    }

    public ServiceException(HttpCodeEnum httpCodeEnum) {
        this.httpCodeEnum = httpCodeEnum;
        this.msg = httpCodeEnum.getMsg();
    }

    public ServiceException(HttpCodeEnum httpCodeEnum, String msg) {
        this.httpCodeEnum = httpCodeEnum;
        this.msg = msg;
    }
}
